﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace Zj.CourseManage.Domain.Core
{
    /// <summary>
    /// 学生
    /// </summary>
    public class Student
    {
        public Student()
        {
            this.Enrollments = new HashSet<Enrollment>();
            this.Name = string.Empty;
        }
        [Key]
        public int Id { get; set; }
        public string Name { get; set; }

        [DisplayFormat(DataFormatString ="{0:yyyy-MM-dd}")]
        [DataType(DataType.Date)]
        public DateTime Birthday { get; set; }

        public string  Introduction { get; set; }

        public virtual ICollection<Enrollment> Enrollments { get; set; }


        public int DepartmentId { get; set; }



        [ForeignKey("DepartmentId")]
        public virtual Department Department { get; set; }
    }
}
